﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RemoteDownload.Domain.Model.FileManagerAggregateRoot;
using RemoteDownload.Contract;

namespace RemoteDownload.Domain.Adapter
{
    public class ContractConverter
    {
        public static IList<FileInfoDTO> GetDownloadListResponseConverter(IList<FileInfo> files)
        {
            var filesDTO = new List<FileInfoDTO>();
            files.ToList().ForEach(f => {
                filesDTO.Add(new FileInfoDTO() { FileName = f.FileName + "." + f.Ext, DownloadTime = f.DownloadTime, Size = f.Size });
            });
            return filesDTO;
        }
    }
}
